﻿using MediatR;
using SheepStorage.API.Application.Command.SheepMomDeliveryCommand;
using SheepStorage.API.Application.Command.SheepMomPergnantCommand;
using SheepStorage.API.Baseclass;
using SheepStorage.Service.DataImp;
using SheepStorage.Service.Interface;

namespace SheepStorage.API.Application.CommandHandlers.SheepMomDeliveryHandler
{
    public class SheepMomDeliveryDelCommandHandler : IRequestHandler<SheepMomDeliveryDelCommand, Results<int>>
    {
        private readonly ISheepMomDeliveryService SheepMomDeliveryService;
        public SheepMomDeliveryDelCommandHandler(ISheepMomDeliveryService SheepMomDeliveryService)
        {
            this.SheepMomDeliveryService = SheepMomDeliveryService;
        }
        public async Task<Results<int>> Handle(SheepMomDeliveryDelCommand request, CancellationToken cancellationToken)
        {
            return Results<int>.DataResult(await SheepMomDeliveryService.DelSheepMomDelivery(request.MomDeliveryId));
        }
    }
}
